package listener;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.ServletRequestEvent;
import javax.servlet.ServletRequestListener;
import javax.servlet.annotation.WebListener;

@WebListener
public class MyListener implements
        ServletContextListener, ServletRequestListener {
    public void contextInitialized(ServletContextEvent arg0) {
        //System.out.println("ServletContext对象被创建了");
    }
    public void contextDestroyed(ServletContextEvent arg0) {
        //System.out.println("ServletContext对象被销毁了");
    }
    @Override
    public void requestDestroyed(ServletRequestEvent servletRequestEvent) {
        //System.out.println("ServletRequest对象被销毁了");
    }
    @Override
    public void requestInitialized(ServletRequestEvent servletRequestEvent) {
        //System.out.println("ServletRequest对象被创建了");
    }

}
